package com.zmx.doctor.adapter;


import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.doctor.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class OrderImageAdapter extends BaseAdapterRvList<OrderImageAdapter.ViewHolder, String> {

    public OrderImageAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, String s) {

        Log.e("进来了","图片路径："+s);
        Glide.with(mActivity).load(s).into(holder.image);

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {

        OrderImageAdapter.ViewHolder holder = new OrderImageAdapter.ViewHolder(inflater.inflate(R.layout.order_image_adapter, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.image)
        ImageView image;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }
}
